package system_code.read_write;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintWriter;

public class demo5 {
    public static void main(String[] args) throws IOException {
        //文本文件用PrintWrite可以简化使用
        //通过try可以不用close，try块结束，自动释放内存
        try (OutputStream outputStream = new FileOutputStream("./bbb.txt")) {
            PrintWriter writer = new PrintWriter(outputStream);
            writer.println();
            writer.printf("a = %d\n", 10);
        }
    }
}
